#include <stdio.h>
int main()
{
    int t,n,i;
    while (scanf("%d",&n)!=EOF)
    {
        t=-1;
        for (i=1;i<=n;i++)
            if (n%i==0)t=-t;
        if (t<0)printf("0\n");
        else printf("1\n");
    }
    return 0;
}
